package com.lsa.letcode.the8.atoi;


import org.junit.Assert;
import org.junit.Test;

public class AtoiTest {
	@Test
	public void test() {
		Solution s = new Solution();
		Assert.assertEquals(-123, s.atoi("-123"));
		Assert.assertEquals(5, s.atoi("5"));
		Assert.assertEquals(5, s.atoi("+5"));
		Assert.assertEquals(123, s.atoi("123"));
		Assert.assertEquals(1234, s.atoi("1234"));
		Assert.assertEquals(1234, s.atoi("1234"));
		Assert.assertEquals(1234, s.atoi("1234wsd"));
		Assert.assertEquals(1234, s.atoi("   1234wsd"));
		Assert.assertEquals(-123, s.atoi("   -123 sds"));
		Assert.assertEquals(2147483647, s.atoi("2147483647"));
		Assert.assertEquals(-2147483647, s.atoi("-2147483647"));
		Assert.assertEquals(-2147483648, s.atoi("-2147483648"));
		Assert.assertEquals(2147483647, s.atoi("2147483648"));
	}
}
